#define _CRT_SECURE_NO_WARNINGS 1 
#include<iostream>
using namespace std;

int multiply1(int A, int B) {
    return B ? (multiply1(A << 1, B >> 1) + (B & 1 ? A : 0)) : 0;
}

int multiply2(int A, int B) {
    int ret = 0;
    while (B) {
        if (B & 1)
            ret += A;
        B >>= 1;
        if (B)
            A += A;
    }
    return ret;
}

int multiply3(int A, int B) {
    int ret = 0;
    int max = A;
    int min = B;
    if (max < min)
    {
        int temp = max;
        max = min;
        min = temp;
    }
    for (int i = 0; i < min; i++)
        ret += max;
    return ret;
}

int multiply4(int A, int B) {
    bool arr[A][B];
    return (int)sizeof(arr);
}
int main()
{
    cout << multiply1(11, 5) << endl;
    cout << multiply2(11, 5) << endl;
    cout << multiply3(11, 5) << endl;
    cout << multiply4(11, 5) << endl;

	return 0;
}